package csu.web.mypetstore.service;

import csu.web.mypetstore.domain.Account;
import csu.web.mypetstore.domain.Log;
import csu.web.mypetstore.persistence.LogDao;
import csu.web.mypetstore.persistence.impl.LogDaoImpl;

import java.util.List;

public class LogService {
    private Log log;
    private LogDao logDao;

    public LogService() {
        log = new Log();
        logDao = new LogDaoImpl();
    }

    public String logInfo(Object ...s) {
        return log.logInformation(s);
    }

    public void insertLogInfo(String username, String logInfo) {
        logDao= new LogDaoImpl();
        logDao.insertLog(username,logInfo);
    }

    public List<String> getLogInfo(Account account) {
        return logDao.getLogInfoByUsername(account);
    }
}
